-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap the managed worker thread pool to disallow shutdown on prod mode #43268
Wrap the managed worker thread pool to disallow shutdown on prod mode #43268
Conversation
managed = new ManagedScheduledExecutorService(underlying); | ||
} | ||
current = managed; | ||
return managed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, isn't the Vert.x worker thread pool backed by this very ExecutorService
in the prod mode? If so, then we could remove the vertx-specific stuff for the prod mode here: https://github.com/quarkusio/quarkus/blob/main/extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java#L110
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let's try to simplify the code! Except that we don't have a test for this. I guess that we could at least try to run the reproducer from #16833 manually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, let me remove the draft to run the existing test suite. I can also reproduce with #43228.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we allow the shutdown only on dev mode. It'd be better if tests were closer to prod.
core/runtime/src/main/java/io/quarkus/runtime/util/ManagedScheduledExecutorService.java
Outdated
Show resolved
Hide resolved
faee35e
to
79ed309
Compare
This comment has been minimized.
This comment has been minimized.
extensions/vertx/runtime/src/main/java/io/quarkus/vertx/core/runtime/VertxCoreRecorder.java
Show resolved
Hide resolved
68822e5
to
c7ad32e
Compare
.../vertx/deployment/src/test/java/io/quarkus/vertx/deployment/VertxWorkerPoolShutdownTest.java
Show resolved
Hide resolved
c7ad32e
to
c42c057
Compare
From my POV this pull request is ready for merge but let's wait for CI and @cescoffier! |
This comment has been minimized.
This comment has been minimized.
I'll push again, formatting error... |
…on/other extensions Related to quarkusio#16833 quarkusio#43228
c42c057
to
c37ec43
Compare
Status for workflow
|
Seen in #43228 : when injected the worker thread pool can be shutdown preemptively by extensions and app during the shutdown sequence.
This change disallows them to shutdown the worker executor service on prod mode.
VertxCoreRecorder
after Vertx: use NoopShutdownExecutorService and DevModeExecutorService #38478VirtualThreadsExecutor
@mkouba , @cescoffier